Blog

ColdBox 3.0.0 Means Simplicity!

Luis Majano March 19, 2010

Spread the word

Luis Majano

March 19, 2010

Spread the word


Share your thoughts

I am preparing to release the M5 milestone for ColdBox 3.0.0 and I am really amazed at how simple ColdBox 3 is becoming not only in syntax but in principle. I am really excited about this release as it is a push forward in ALL areas of development. Lots of modularity and re-architecture has gone into the core and the results have been amazing. A speed and performance improvement of over 20-30% from 2.6.4 on same code bases have usually been seen and that is without adding the speed of engines like Railo and CF9. Not only that, we have made our motto: simplicity. That is why in this release (M5), you will see that we now have inheritless objects. All objects used within ColdBox are now simple CFCs that are mixed in or decorated at runtime by the engine. Not only that, the engine can discover the family type of the object and choose to decorate it or not. We have even added the ability to override and call virtual methods and thus giving the resemblance of inheritance. Anyways, too much information, but let's look at some cool code now. Event Handler: /** * Cool simple component with few actions * @cache true * @cacheTimeout 45 */ component{ function index(event){ var rc = event.getCollection(); rc.welcome = "Hi There"; event.setView("simple.index"); } function sayHello(event){ return "Rendering a simple message baby!"; } function renderHello(event){ event.renderData(data="

Welcome to my world!

"); } } Cool! Simple enough, 1 action sets a variable and sets a view for rendering, another view returns a string to be rendered and the third action uses renderdata to marshal data back to the screen. Easy enough hugh? Plugins: Plugins can also be now ANY CFC, no matter where it comes from, ColdBox will use it. Just drop it in the plugins convention folder and use! Also, simple CFCs. /** * My Awesome printing plugin * @singleton true */ component{ /** * @inject */ property name="dateService"; function init(){ setPluginAuthor("Luis Majano"); setPluginVersion("1.0"); setPluginDescription("A cool awesome printing module"); return this; } function printToday(dateFormat, timeFormat){ return dateService.getNow(argumentCollection=arguments); } } Is that cool or what, no inheritance, cool annotations for persistance and dependency injection. So what about interceptors? The same man, what you think, we just tease you a bit. /** * My awesome AOP interceptor */ component{ /** * @eventPattern ^(users?|security|admin) */ function preProcess(event,interceptData){ getPlugin("Timer").start("Processing-#event.getCurrentEvent()#"); } /** * @eventPattern ^(users?|security|admin) */ function postProcess(event,interceptData){ getPlugin("Timer").stop("Processing-#event.getCurrentEvent()#"); } /** * @interceptionPoint */ function onMyException(event, interceptData){ // Do Something } } Now this is even more awesome, you can now define an annotation called "eventPattern" which is a regular expression that matches against the incoming event string. If it does, then it calls the interception point, else it ignores it. In this case, I will do AOP timing for events that start with "users,user,security,admin". Not only that you can also create an annotation called "interceptionPoint" and that tells the platform to register this method as a custom observation or interception point. Ok everybody, more interesting posts about 3.0.0 are coming as development continues. Also, we have now almost fully documented all the new features and compatibilities in our new wiki:

Update: For all CF8 code snippets var rc = event.getCollection(); rc.welcome = "Hi There"; event.setView("simple.index"); setPluginAuthor("Luis Majano"); setPluginVersion("1.0"); setPluginDescription("A cool awesome printing module"); return this;

Add Your Comment

(4)

Mar 18, 2010 22:39:43 UTC

by Sami Hoda

Sweet! Congrats!

Mar 18, 2010 23:50:33 UTC

by dickbob

Can you write your examples in a CF8 compatible style in future. Not all of us are playing with the cool CF9 kids yet :-)

Mar 19, 2010 06:05:42 UTC

by Curt Gratz

I can't imagine life without some of the awesomeness in verision 3.0.0. Thanks for all your hard work to make all our lives easier. YTM.

Mar 19, 2010 10:49:52 UTC

by Luis Majano

@dickbob Here are some cf8 goodness for ya!

Recent Entries

Ortus June 2024 Newsletter!

Ortus June 2024 Newsletter!

Welcome to the latest edition of the Ortus Newsletter! This month, we're excited to bring you highlights from our sessions at CFCamp and Open South Code, as well as a sneak peek into our upcoming events. Discover the latest developments in BoxLang, our dynamic new JVM language, and catch up on all the insightful presentations by our expert team. Let's dive in!

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang June 2024 Newsletter!

BoxLang June 2024 Newsletter!

We're thrilled to bring you the latest updates and exciting developments from the world of BoxLang. This month, we're diving into the newest beta release, introducing a new podcast series, showcasing innovative integrations, and sharing insights from recent events. Whether you're a seasoned developer or just getting started, there's something here for everyone to explore and enjoy.

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang 1.0.0 Beta 3 Launched

BoxLang 1.0.0 Beta 3 Launched

We are thrilled to announce the release of BoxLang 1.0.0-Beta 3! This latest beta version is packed with exciting new features and essential bug fixes, including robust encryption functionality, enhanced Java interoperability, and more efficient event handling. Key highlights include the introduction of query caching capabilities, seamless coercion of Java Single Abstract Method (SAM) interfaces from BoxLang functions, and support for virtual thread executors. So, let’s dive into the details of what’s new in BoxLang 1.0.0-Beta 3 and how you can start leveraging these updates today!

Luis Majano
Luis Majano
June 28, 2024